package com.gzh.teaching.model.vo;

import com.gzh.core.util.NumericHelper;
import com.gzh.teaching.service.dto.SaveJobIn;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.List;

/**
 * @Author guanzh
 * @Date 2022/1/24 17:06
 * @Description
 */
@Setter
@Getter
@ToString
public class SaveJobParam {
    private String workId;

    private String courseId;

    private String title;

    private List<SingleVo> singleList;

    private List<MultipleVo> multipleList;

    private List<FillVo> fillList;

    private List<JudgeVo> judgeList;

    private List<ShortVo> shortList;

    private String workType;

    private String fileId;


    public SaveJobIn paramToIn(Integer userId) {
        SaveJobIn in = new SaveJobIn();
        in.setWorkId(NumericHelper.toInteger(this.workId));
        in.setCourseId(NumericHelper.toInteger(this.courseId));
        in.setTitle(this.title);
        in.setUserId(userId);
        in.setSingleList(this.singleList);
        in.setMultipleList(this.multipleList);
        in.setFillList(this.fillList);
        in.setJudgeList(this.judgeList);
        in.setShortList(this.shortList);
        in.setWorkType(NumericHelper.toInteger(this.workType));
        in.setFileId(NumericHelper.toInteger(this.fileId));
        return in;
    }

}
